#include "HandbrkUniteView.h"
#include "BrakeLevelModel.h"
#include "EbdModel.h"
#include "HandBrkModel.h"

uint8_t handbrk_unite_visble_mask = 0;

void refresh_tt0View(ItuElement* elememt, bool isUnconditional)
{
    Option_U8 brakeLevel = getBrakeLevelShowFlag();
    Option_U8 ebd        = getEbdShowFlag();
    Option_U8 handbrk    = getHandbrkShowFlag();

    if(brakeLevel.update_ || ebd.update_ || handbrk.update_)
    {
        if(brakeLevel.value_ || ebd.value_ || handbrk.value_)
        {
            ituCheckBoxSetChecked((ITUCheckBox*)elememt->widget_, true);
        }
        else
        {
            ituCheckBoxSetChecked((ITUCheckBox*)elememt->widget_, false);
        }
        brakeLevel.update_ = false;
        ebd.update_ = false;
        handbrk.update_ = false;
    }
}

void reporting_self_validity_tt0View(ItuElement* elememt)
{
    uint8_t mask = (elememt && elememt->isVaild_) ? 0x01 : 0x00;
    handbrk_unite_visble_mask <<= 1;
    handbrk_unite_visble_mask |= mask;
}